<%@ page import="java.util.ArrayList" %>
<%@ page import="cn.itcast.domain.Student" %><%--
  Created by IntelliJ IDEA.
  User: 佐佑
  Date: 2020/7/10
  Time: 17:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查看学生</title>
</head>
<body>
    <table width="170px" border="1px" style=" border: lightskyblue ;margin: 0 auto">
        <tr>
            <th>姓名</th>
            <th>年龄</th>
            <th>成绩</th>
        </tr>

    <%
        ArrayList<Student> list = (ArrayList) session.getAttribute("student");
        for (Student student : list) {
            String username = student.getUsername();
            String age = student.getAge();
            String score = student.getScore();
    %>
        <tr>
            <td><%=username%></td>
            <td><%=age%></td>
            <td><%=score%></td>
        </tr>

        <%}%>
    </table>
    <a href="<%=application.getContextPath()%>/index.jsp">返回</a>
</body>
</html>
